package IO;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * 文件输入流FileInputStream,用于从文件中读取数据
 */
public class FisDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("fos.dat");

        int d = fis.read();
        System.out.println(d);  //1

        d = fis.read();  //2
        System.out.println(d);

        d = fis.read();  //-1-------文件末尾读出为-1
        System.out.println(d);

        fis.close();  //关闭输入流

    }
}
